package edu.pku.sei.modeler.figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.CompoundBorder;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.swt.graphics.Color;

public class MetaCompoundNodeFigure  extends Figure {
	public static final Color CLASS_COLOR = new Color(null,0,255,0);
	private IFigure body;
	private IFigure header;
	private IFigure attrCompart;
	private IFigure opCompart;
	
	public MetaCompoundNodeFigure(IFigure header){
		this.header = header;
		ToolbarLayout layout = new ToolbarLayout();
		setLayoutManager(layout);	
		setBorder(new CompoundBorder(new LineBorder(ColorConstants.buttonDarker,1), new MarginBorder(1)));
		setBackgroundColor(CLASS_COLOR);
		setOpaque(true);
		add(header);
		body = new Figure();
		body.setLayoutManager(new ToolbarLayout());
		attrCompart = new CompartmentFigure();
		opCompart = new CompartmentFigure();
		body.add(attrCompart);
		body.add(opCompart);
		add(body);
	}
	public IFigure getContentPane() {
		return body;
	}

	public IFigure getHeader() {
		return header;
	}
	
	public IFigure getAttrCompart() {
		return attrCompart;
	}
	
	public IFigure getOpCompart() {
		return opCompart;
	}
}
